home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 5201 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.1 KB  |  27 lines

  1. Newsgroups: comp.lang.c++
  2. Path: neumann.uwaterloo.ca!hylo
  3. From: hylo@neumann.uwaterloo.ca (Grace Hai Yan Lo)
  4. Subject:  How to convert char to hex in C++? 
  5. Sender: news@undergrad.math.uwaterloo.ca (news spool owner)
  6. Message-ID: <DM679K.BD1@undergrad.math.uwaterloo.ca>
  7. Date: Fri, 2 Feb 1996 22:46:32 GMT
  8. Nntp-Posting-Host: neumann.uwaterloo.ca
  9. Organization: University of Waterloo
  10. Keywords: hex
  11.  
  12.     I just wonder if anyone know how to convert a char (e.g. 'a') to
  13. hex digit (i.e. 61 for 'a') in C++?  Somehow the cout << hex << n <<endl;
  14. works for n being an integer but not a character.  Thanks.
  15.  
  16.  
  17. Grace Lo 
  18.  
  19. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  20. ! Grace Hai Yan Lo                %  email    : hylo@neumann.uwaterloo.ca !
  21. ! Department of Computer Science  %  Office   : DC3511, U. of W.          !
  22. ! University of Waterloo          %  Tel. no. : (519) 888-4567 ext 3512   !
  23. ! Waterloo  ONT                   %  Program  : Master in Computer Science!   
  24. ! N2L 3G1   Canada                %  Research : Mobile Computing          !
  25. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  26.  
  27.